package com.pay.merchant.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.pay.entity.Order;
import com.pay.merchant.mapping.MappingUtils;
import com.pay.service.IOrderService;
import com.pay.utils.BasePage;

@Controller
public class OrderController {

	@Autowired
	private IOrderService orderService ;
	
	@RequestMapping(value=MappingUtils.showOrderList)
	public ModelAndView showOrderList(Order order,BasePage<Order> page,Integer loginId) {
		order.setMerchantId(loginId); 
		orderService.getList(order, page);
		ModelAndView m = new ModelAndView(MappingUtils.showOrderList);
		m.addObject("order", order) ;
		m.addObject("loginId", loginId) ;
		m.addObject("list", page); 
		return m ; 
	}
}
